import React from 'react';
import styles from "./App.module.css";
import {BrowserRouter,Route, Routes } from "react-router-dom"
import {Detail, HomePage, RegisterPage, SignInPage} from "./pages";

function App() {
  return (
      <div className={styles.App}>
        <BrowserRouter>{/*用来包裹所有的页面*/}
          <Routes>{/*代替Switch组件,不会向下匹配*/}
            <Route path="/" element={<HomePage />} />
            <Route path="/sign-in" element={<SignInPage />}/>
            <Route path="/register" element={<RegisterPage />}/>
            <Route path="/detail/:id" element={<Detail />}/>
            <Route path="*" element={<h1>404 Not Found</h1>}/>
          </Routes>
        </BrowserRouter>
      </div>
  );
}

export default App;
